package com.chushouya.manager.dto.admin.bonustype;

import com.chushouya.manager.constants.BonusTypeEnum;
import com.chushouya.manager.constants.BonusTypeSendTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;


@Data
@ApiModel("红包类型列表")
public class BonusTypeListDTO {

    @ApiModelProperty("id")
    private Long typeId;

    @ApiModelProperty("红包名称")
    private String typeName;

    @ApiModelProperty("发放类型 1、按用户发放 2、按商品发放 3、按订单金额发放 4、线下发放的红包, BonusTypeSendTypeEnum")
    private Integer sendType;

    private String sendTypeDesc;

    @ApiModelProperty("红包金额")
    private BigDecimal typeMoney;

    @ApiModelProperty("订单下限")
    private BigDecimal minAmount;

    @ApiModelProperty("发放数量")
    private Long sendNumber;

    @ApiModelProperty("领取数量")
    private Long receiveNumber;

    @ApiModelProperty("红包券类型")
    private Integer bonusType;

    @ApiModelProperty("红包券类型")
    private String bonusTypeDesc;

    @ApiModelProperty("有效期")
    private Integer useDay;

    @ApiModelProperty("开始使用日期")
    private Date startTime;

    @ApiModelProperty("结束使用日期")
    private Date endTime;

    @ApiModelProperty("创建时间")
    private Date createTime;

    public String getSendTypeDesc() {
        return BonusTypeSendTypeEnum.getDesc(sendType);
    }

    public String getBonusTypeDesc() {
        return BonusTypeEnum.getDesc(bonusType);
    }
}
